<?php

defined('_JEXEC') or die;

class TourModeltourcountrydetail extends JModelList {

    public function __construct($config = array()) {
        if (empty($config['filter_fields'])) {
            $config['filter_fields'] = array(
                'id', 'a.id',
                'name', 'a.name',
                'image', 'a.image',
                'detail', 'a.detail',
                'ordering', 'a.ordering',
                'state', 'a.state'
            );
        }
        parent::__construct($config);
    }

    protected function getListQuery() {
        $db = $this->getDbo();
        $query = $db->getQuery(true);
        $query->select(
                $this->getState(
                        'list.select', 'a.id, a.name,' .
                    
                 'a.image ,'.
                 'a.detail ,'.
                 'a.ordering ,'.
                 'a.state '
                )
        );
        $query->from($db->quoteName('#__tour_tourcountrydetail') . ' AS a');
        $query->where(" a.state =1");
        $query->where("a.image NOT LIKE ''");
        return $query;
    }

}
